package ControlLayer;
import ModelLayer.Tax;
import DBLayer.DBTax;
import java.util.ArrayList;

public class CtrTax {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrTax instance = null;
    DBTax dbTax = new DBTax();

    public CtrTax() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrTax getInstance() {
        if (instance == null) {
            instance = new CtrTax();
        }
        return instance;
    }

    public ArrayList<Tax> getTaxList() {
        return dbTax.getTaxList();
    }

    public Tax getTaxByID(int id) {
        return dbTax.getTaxByID(id);
    }

    public int addTax(Tax tax) {
        return dbTax.addTax(tax);
    }

    public int updateTax(Tax tax, int id) {
        return dbTax.updateTax(tax, id);
    }

    public void deleteTax(int id) {
        dbTax.deleteTax(id);
    }
    // </editor-fold>
}
